package com.padgett.resourcemanagement.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public final class DateUtil {
	public static final String DATE_FORMAT="MM/dd/yyyy";
	public static final String SHORT_DATE_FORMAT="MMM dd, yyyy";
	public static final String MONTH_DATE_FORMAT="MMMM yyyy";
	public static final String LONG_DATE_FORMAT="MMMM dd, yyyy";
	public static final SimpleDateFormat sdf=new SimpleDateFormat(DATE_FORMAT);
	public static Date parseDate(String dateString,String pattern) throws ParseException{
		sdf.applyPattern(pattern);
		return sdf.parse(dateString);
	}
	public static String formatDate(Date date,String pattern){
		sdf.applyPattern(pattern);
		return sdf.format(date);
	}
}
